/**
 * Copyright 2011 AJG van Schie
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */
package com.googlecode.julius.data.define;

import java.util.List;

import julius.utilities.CollectionHelper;

import org.joda.time.LocalDate;

import com.googlecode.julius.utils.DateHelper;

public class SprintPeriod {

    private final LocalDate start;
    private final LocalDate end;

    public SprintPeriod(final LocalDate start, final LocalDate end) {
        super();
        this.start = start;
        this.end = end;
    }

    public List<LocalDate> getSprintDays() {
        return CollectionHelper.allExceptLast(DateHelper.getSprintDays(start, end)); // last day is not part of sprint...
    }

    public LocalDate getStart() {
        return start;
    }

    public LocalDate getEnd() {
        return end;
    }

    @Override
    public String toString() {
        return "[" + start + " t/m " + end + "]";
    }
}
